package com.example.example.fragment;

import android.view.View;
import android.widget.ImageView;

import com.example.example.R;

/***
 * Created by Administrator on 2017/11/4.
 */

public class OneFragment extends BaseFragment {

    private ImageView one_img, two_img, three_img;

    @Override
    protected void initData() {

    }

    @Override
    protected void initView() {
        one_img = (ImageView) findViewById(R.id.one_img);
        two_img = (ImageView) findViewById(R.id.two_img);
        three_img = (ImageView) findViewById(R.id.three_img);

        if(imageClick!=null){
            one_img.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    imageClick.oneImageClick(v);
                }
            });
            two_img.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    imageClick.twoImageClick(v);
                }
            });
            three_img.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    imageClick.threeImageClick(v);
                }
            });
        }
    }

    @Override
    public int getFragmentViewById() {
        return R.layout.one_fragment;
    }

    private onImageClick imageClick;

    public void setImageClick(onImageClick imageClick) {
        this.imageClick = imageClick;
    }

    public interface  onImageClick{
        void oneImageClick(View view);
        void twoImageClick(View view);
        void threeImageClick(View view);
    }

}
